package com.raitcon.hibernate.bean;
// Generated 27/05/2014 07:54:56 AM by Hibernate Tools 3.2.1.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Roles generated by hbm2java
 */
@Entity
@Table(name = "roles", schema = "public")
public class Roles implements java.io.Serializable {

    private int idRol;
    private String name;
    private Character state;
    private Date registry;
    private Set<MaUsuarios> maUsuarioses = new HashSet<MaUsuarios>(0);
    private Set<RolesAccion> rolesAccions = new HashSet<RolesAccion>(0);
    private Set<MaUsuarios> maUsuarioses_1 = new HashSet<MaUsuarios>(0);

    public Roles() {
    }

    public Roles(int idRol) {
        this.idRol = idRol;

    }

    public Roles(int idRol, String name) {
        this.idRol = idRol;
        this.name = name;
    }

    public Roles(int idRol, String name, Character state, Date registry, Set<MaUsuarios> maUsuarioses, Set<RolesAccion> rolesAccions, Set<MaUsuarios> maUsuarioses_1) {
        this.idRol = idRol;
        this.name = name;
        this.state = state;
        this.registry = registry;
        this.maUsuarioses = maUsuarioses;
        this.rolesAccions = rolesAccions;
        this.maUsuarioses_1 = maUsuarioses_1;
    }

    @Id
    @Column(name = "id_rol", unique = true, nullable = false)
    public int getIdRol() {
        return this.idRol;
    }

    public void setIdRol(int idRol) {
        this.idRol = idRol;
    }

    @Column(name = "name", nullable = false, length = 50)
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "state", length = 1)
    public Character getState() {
        return this.state;
    }

    public void setState(Character state) {
        this.state = state;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "registry", length = 29)
    public Date getRegistry() {
        return this.registry;
    }

    public void setRegistry(Date registry) {
        this.registry = registry;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "roles")
    public Set<MaUsuarios> getMaUsuarioses() {
        return this.maUsuarioses;
    }

    public void setMaUsuarioses(Set<MaUsuarios> maUsuarioses) {
        this.maUsuarioses = maUsuarioses;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "roles")
    public Set<RolesAccion> getRolesAccions() {
        return this.rolesAccions;
    }

    public void setRolesAccions(Set<RolesAccion> rolesAccions) {
        this.rolesAccions = rolesAccions;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "roles")
    public Set<MaUsuarios> getMaUsuarioses_1() {
        return this.maUsuarioses_1;
    }

    public void setMaUsuarioses_1(Set<MaUsuarios> maUsuarioses_1) {
        this.maUsuarioses_1 = maUsuarioses_1;
    }

    @Override
    public String toString() {
        return "Rol{" + "idRol= " + idRol + " " + "name: " + name + " " + "state: " + state + " " + "registry: " + " " + registry + "}";
    }
}
